//
//  WYHttpServer+WYUser.m
//  Boss
//
//  Created by admin on 2018/7/7.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHttpServer+WYUser.h"

@implementation WYHttpServer (WYUser)
+(void)getUserMessageSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserGetUserInfo WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getTaskListSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlTaskSelectUserTask WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}



+(void)getMyInfoSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserMyInfo WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}


+(void)editUserMessageWithHeadImgUrl:(NSString *)headImgUrl WithUserName:(NSString *)userName WithSex:(NSString *)sex WithBirthday:(NSString *)birthday WithProvince:(NSString *)province WithCity:(NSString *)city WithPrefecture:(NSString *)prefecture SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:headImgUrl forKey:@"headImgUrl"];
    [parm setValue:userName forKey:@"userName"];
    [parm setValue:sex forKey:@"sex"];
    [parm setValue:birthday forKey:@"birthday"];
    [parm setValue:province forKey:@"province"];
    [parm setValue:city forKey:@"city"];
    [parm setValue:prefecture forKey:@"prefecture"];
    
    
    
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlEditUserInfo WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
    
    
    
}

+(void)getUserWalletSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetWallet WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)getUserWalletRecord:(NSString *)pageSize WithCurrentPage:(NSString *)currentPage WithType:(NSString *)type SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    
    [parm setValue:pageSize forKey:@"pageSize"];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:type forKey:@"type"];
    
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetWalletRecord WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)getAttentionWithType:(NSString *)type SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:type forKey:@"type"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetAttention WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}
+(void)getCollectListSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetCollect WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
}
+(void)getUserReplySucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetUserReply WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getBossTeamSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlGetBossTeam WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}
+(void)getIntoPersonHomePageSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserCenterNew WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}

+(void)editCompanyNameWithCompanyName:(NSString *)companyName SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:companyName forKey:@"companyName"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditCompanyName WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}
+(void)editCompanyNameWithCompanyintro:(NSString *)companyIntro SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:companyIntro forKey:@"companyIntro"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditCompanyIntro WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)editdutyWithCompanyduty:(NSString *)duty SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:duty forKey:@"duty"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditDuty WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)editdutyWithProfession:(NSString *)profession SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:profession forKey:@"profession"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditProfession WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)editComPanyAddressWithadddress:(NSString *)companyAddress SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:companyAddress forKey:@"companyAddress"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditCompanyAddress WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}
+(void)editComPanyTimeWithTime:(NSString *)registerTime SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:registerTime forKey:@"registerTime"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditRegisterTime WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}


+(void)addProductSerViceWithPicUrl:(NSString *)picUrl WithTitle:(NSString *)title WithContent:(NSString *)content SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:picUrl forKey:@"picUrl"];
    [parm setValue:title forKey:@"title"];
    [parm setValue:content forKey:@"content"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserProductService WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}
+(void)addHonor:(NSString *)companyHonor SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:companyHonor forKey:@"companyHonor"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserCompanyHonor WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)addUserCompanyLogo:(NSString *)companyUrl SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:companyUrl forKey:@"companyUrl"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUsereditCompanyUrl WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}


+(void)getHomePageUserMessageSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserUserMessage WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
}

+(void)editPersonBackGroundWithBackground:(NSString *)background SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:background forKey:@"background"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditBackground WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
    
    
    
    
}
+(void)getProductServiceWithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserGetProductService WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
/**
 *修改产品服务信息
 */

+(void)editProductServiceWithID:(NSString *)ID WithPicUrl:(NSString *)picUrl WithTitle:(NSString *)title WithContent:(NSString *)content SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:ID forKey:@"id"];
    [parm setValue:picUrl forKey:@"picUrl"];
    [parm setValue:title forKey:@"title"];
    [parm setValue:content forKey:@"content"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserEditProductService WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

/**
 *删除产品服务信息
 */

+(void)deleteProductServiceWithID:(NSString *)ID SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:ID forKey:@"id"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserDeleteProductService WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}






+(void)getMyDynamicWithCurrentPage:(NSString *)currentPage WithPageSize:(NSString *)pageSize SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [parm setValue:pageSize forKey:@"pageSize"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserMyDynamic WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)deleteMyDynamicWithMessageId:(NSString *)messageId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:messageId forKey:@"messageId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserDeleteMyDynamic WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}



+(void)getUserTaskSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlTaskCheckUserTask WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}
/**
 *查看消息列表
 */
+(void)getMessageListWithCurrentPage:(NSString *)currentPage SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:currentPage forKey:@"currentPage"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlTMessageList WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}
+(void)getMessageDetailWithMsgId:(NSString *)msgId SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:msgId forKey:@"msgId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlTMessageDetail WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)getUnreadNumberSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlTMessageUnreadNumber WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)followUserOrUnFollowUser:(NSString *)attUserId WithAttentionState:(NSString *)attentionState SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:attUserId forKey:@"attUserId"];
    [parm setValue:attentionState forKey:@"attentionState"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserAttentionUser WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}
+(void)checkAttentionState:(NSString *)attUserId  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
     [parm setValue:attUserId forKey:@"attUserId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserCheckAttentionState WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}

+(void)seeUerHomePage:(NSString *)userId  SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:userId forKey:@"userId"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserGetUserCenter WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
}
+(void)addFeedBackWithContent:(NSString *)content WithContact:(NSString *)contact SucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [parm setValue:content forKey:@"content"];
    [parm setValue:contact forKey:@"contact"];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlUserAddFeedback WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
}


+(void)getHeroPushSucessBlock:(void(^)(BOOL success,id response,NSString *errorMessage))completion
{
    
    AFHTTPSessionManager *manager=[[WYHttpServer sharedInstance] requestManager];
    NSMutableDictionary *parm=[[WYHttpServer sharedInstance] requestParameters];
    [[WYHttpServer sharedInstance] postOperationWithManger:manager Url:kUrlHeroPush WithPara:parm Success:^(BOOL success, id response, NSString *errorMsg) {
        completion(success,response,errorMsg);
    }];
    
    
    
}





@end
